﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>添加收藏</title>
		<link href="css/table.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
		<script type="text/javascript">
	function addFavorite(){
		var title =$("#title").val();
		var address =$("#address").val();
		if($.trim(title)==''||$.trim(title)=='null'){
			  alert("名称不能为空");
			return;
		}
		if($.trim(address)==''||$.trim(address)=='null'){
			  alert("网址不能为空");
			return;
		}
		var param={"favorite.address":$.trim(address),"favorite.title":$.trim(title)};
		$.post("saveFavorite.action",param,function(data){
			if(data=='success'){
				alert("添加成功！");
				window.close();
				window.opener.location.href="favoriteManage.action"
			}else{
				alert("添加失败！");
			}
		});
	}
</script>
	</head>
	<body>
		<table align="center" border="0" cellpadding="0" cellspacing="0" width="98%">
  <tbody>
  <tr>
    <td style="background: url('image/wsoa_window_002.gif');" width="1"></td>
    <td style="background: url('image/wsoa_window_002.gif');"><table border="0" cellpadding="0" cellspacing="0">
      <tbody><tr>
        <td align="center" style="background: url('image/wsoa_window_002.gif');" width="10"><img src="image/center_19.gif"></td>
        <td align="center" style="background: url('image/wsoa_window_002.gif');"></td>
        <td>个人办公 &gt; 我的办公桌 &gt; 常用网址 &gt; 添加</td>
        </tr>
    </tbody>
    </table></td>
    <td style="background: url('image/wsoa_window_002.gif');" width="1"></td>
  </tr>
  <tr>
    <td style="background: url('image/wsoa_window_010.gif');"  width="1">&nbsp;</td>
    <td>
		<table style="width: 100%;" class="table5" align="center">
			<tr>
					<td class="table5 bgcolor5" align="right" width="80px">
						<font color="red">*</font>网址名称
					</td>
					<td class="table5" align="left">
						<input id="title"   name="favorite.title" value="${favorite.title}" style="width: 200px;" type="text">
					</td>
				</tr>
					<tr>
					<td class="table5 bgcolor5" align="right" width="80px">
						<font color="red">*</font>网&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;址
					</td>
					<td class="table5" align="left">
						<input  id="address" name="favorite.address" value="${favorite.address}" style="width: 200px;" type="text">
						<font color="red">[例：http://www.baidu.com]</font>
					</td>
				</tr>
			<tr>
				<td colspan="2" align="center">
					<input  type="button" class="button_02" value="保存" onclick="addFavorite()" />
					<input  type="button" class="button_02" value="关闭" onclick="window.close()" />
				</td>
			</tr>
		</table>
			</td>
<td style="background: url('image/wsoa_window_006.gif');"  width="1">&nbsp;</td></tr>
  <tr>
    <td height="1" width="1"><img src="image/wsoa_window_009.gif" height="16" width="14"></td>
    <td style="background: url('image/wsoa_window_008.gif');" height="1"></td>
    <td height="1" width="1"><img src="image/wsoa_window_007.gif" height="16" width="12"></td>
  </tr>
</tbody>
</table>
	</body>
</html>